package com.yc.web;

import com.yc.entity.Cart;
import com.yc.entity.Category;
import com.yc.entity.Categorysecond;
import com.yc.entity.Product;
import com.yc.vo.Result;
import com.yc.web.hystrix.OrderActionImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "damai-order",fallback = OrderActionImpl.class )
public interface OrderAction {

    // Method queryAll not annotated with HTTP method type (ex. GET, POST)
    @RequestMapping("category/queryAll")
    public Result queryAll();

    @RequestMapping("product/get.do")
    public Product getProduct(@RequestParam int id);

    @RequestMapping("product/new.do")
    public List<Product> getnewproduct();

    @RequestMapping("product/hot.do")
    public List<Product> gethotproduct();

    @RequestMapping("product/queryByCsid")
    public List<Product> getclistByCsid(@RequestParam int csid);

    @RequestMapping("product/queryByCid")
    public List<Product> getclistByCid(@RequestParam int cid);

    @RequestMapping("category/queryCategory.do")
    public List< Category > getCategory();

    @RequestMapping("categorysecond/queryCategorysecond.do")
    public List< Categorysecond > getCategorysecond(@RequestParam int cid);

    @RequestMapping("cart/add")
    public Result addCart(@RequestBody Cart cart);

    @RequestMapping("cart/query")
    public List< Cart > getCart(@RequestParam int uid);

    @RequestMapping("cart/queryByUid")
    public List< Cart > queryByUid(@RequestParam int uid);
}
